import {defineStore,acceptHMRUpdate} from "pinia"

export const useStore=defineStore({
    id:'index',
    state:()=>({name:'luoyu'}),
    getters:{
        myNmae:(state)=>{
            return `getters ${state.name}`
        }
    },
    actions:{
        changeName(name:string){
            this.name=name;
        }
    }
})

if (import.meta.hot) {
    import.meta.hot.accept(acceptHMRUpdate(useStore, import.meta.hot))
}